//
//  HeightAdaption.m
//  AStage_shougongke
//
//  Created by 赵磊 on 16/1/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HeightAdaption.h"

@implementation HeightAdaption
+ (CGFloat)heightWithText:(NSString *)text Size:(CGFloat)size Width:(CGFloat)width
{
    // 1.文本属性
    NSDictionary *dic = @{NSFontAttributeName: [UIFont systemFontOfSize:size]};
    // 2.预计尺寸
    CGSize s = CGSizeMake(width, 10000);
    // 3.计算
    CGRect r = [text boundingRectWithSize:s options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    return r.size.height;
}
@end
